home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gscssub.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.1 KB  |  74 lines

  1. /* Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gscssub.h,v 1.2 2000/09/19 19:00:27 lpd Exp $ */
  20. /* Client interface to color space substitution */
  21.  
  22. #ifndef gscssub_INCLUDED
  23. #  define gscssub_INCLUDED
  24.  
  25. #include "gscspace.h"
  26.  
  27. /*
  28.  * Color space substitution at the library level is similar to, but not
  29.  * identical to, the operation of UseCIEColor in the PostScript language.
  30.  * When the Boolean UseCIEColor parameter of the current device is false,
  31.  * everything operates as normal.  When UseCIEColor is true, the following
  32.  * procedures may substitute another color space for the implied one:
  33.  *
  34.  *    gs_setgray, gs_setrgbcolor, gs_sethsbcolor, gs_setcmykcolor
  35.  *    gs_current_Device{Gray,RGB,CMYK}_space
  36.  *
  37.  * Unlike the PostScript facility, the substitution *is* visible to
  38.  * gs_currentcolorspace, and does *not* affect gs_setcolorspace, or the
  39.  * ColorSpace members of images or shadings.  However, the following
  40.  * procedures recognize when substitution has occurred and return the
  41.  * value(s) appropriate for the pre-substitution space:
  42.  *
  43.  *    gs_currentgray, gs_currentrgbcolor, gs_currenthsbcolor,
  44.  *      gs_currentcmykcolor
  45.  *
  46.  * Thus gs_{current,set}{gray,{rgb,hsb,cmyk}color} are always mutually
  47.  * consistent, concealing any substitution, and gs_{current,set}{colorspace}
  48.  * are mutually consistent, reflecting any substitution.
  49.  * gs_{current,set}color are consistent with the other color accessors,
  50.  * since color space substitution doesn't affect color values.
  51.  *
  52.  * As in PostScript, color space substitutions are not affected by
  53.  * (ordinary) grestore or by setgstate.  Graphics states created by gsave or
  54.  * gstate, or overwritten by currentgstate or copygstate, share
  55.  * substitutions with the state from which they were copied.
  56.  */
  57.  
  58. /* If pcs is NULL, it means undo any substitution. */
  59. int gs_setsubstitutecolorspace(P3(gs_state *pgs, gs_color_space_index csi,
  60.                   const gs_color_space *pcs));
  61. const gs_color_space *
  62.     gs_currentsubstitutecolorspace(P2(const gs_state *pgs,
  63.                       gs_color_space_index csi));
  64.  
  65. /*
  66.  * The following procedures are primarily for internal use, to provide
  67.  * fast access to specific color spaces.
  68.  */
  69. const gs_color_space *gs_current_DeviceGray_space(P1(const gs_state *pgs));
  70. const gs_color_space *gs_current_DeviceRGB_space(P1(const gs_state *pgs));
  71. const gs_color_space *gs_current_DeviceCMYK_space(P1(const gs_state *pgs));
  72.  
  73. #endif /* gscssub_INCLUDED */
  74.